import 'dart:async';
import 'package:awak/common/routers/router_names.dart';
import 'package:flutter/material.dart';
import 'package:beamer/beamer.dart';
import '../../common/values/images.dart';

class SplashPage extends StatefulWidget {
  const SplashPage({super.key});

  @override
  State<SplashPage> createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  @override
  void initState() {
    super.initState();
    Timer(const Duration(seconds: 2), () {
      Beamer.of(context).beamToNamed(RouterNames.login);
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SizedBox.expand(
        child: Image.asset(
          AwakImages.splashBg,
          fit: BoxFit.cover,
        ),
      ),
    );
  }
}